const Friend = require('../models/index').getModel('friend')

const friendService = {
    async getFriend () {
        return Friend.find()
    },
    // 删除分类
    async deleteFriend (friendList) {
        return Friend.deleteMany(friendList)
    },
    // 新增分类
    async insertFriend (friendList) {
        return Friend.insertMany(friendList)
    },
    // 修改一个分类
    async updateOneFriend (id, update) {
        return Friend.findByIdAndUpdate(id, update, { new: true })
    },
}

module.exports = friendService
